home *** CD-ROM | disk | FTP | other *** search
/ PC Open 93 / PC Open 93 CD 2.bin / PDF / webdeveloper / lezione_2 / application / personalizza.asp < prev    next >
Encoding:
Text File  |  2003-10-25  |  1.8 KB  |  73 lines

  1. <% 
  2.     ' Estraggo il nome utente e la password inseriti dall'utente e li salvo in sessione
  3.     if  request.QueryString("utente") <> "" then
  4.         Session("utente") = request.QueryString("utente")
  5.         Session("password") = request.QueryString("password")
  6.     end if
  7.     
  8.     ' L'utente si Φ correttamente registrato se i dati di sessione sono quelli salvati nell'oggetto application
  9.     if Session("utente") = Application("utente") And _
  10.         Session("password") = Application("password") Then
  11. %>
  12.  
  13. <%
  14.     if request.QueryString("colore") <> "" then
  15.         Session("colore") = request.QueryString("colore")
  16.     end if
  17. %>
  18. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  19.  
  20. <html>
  21. <head>
  22.     <title>Il sito di Mario Rossi</title>
  23. </head>
  24.  
  25. <% if Session("colore") <> "" then %>
  26. <body bgcolor="<%=Session("colore")%>">
  27. <% else %>
  28. <body>
  29. <% end if %>
  30.  
  31. <table width="100%" border="1" cellpadding="0" cellpadding="2">
  32. <tr>
  33.     <td width="100">
  34.  
  35.     <!--#include file="includemenu.asp"-->
  36.  
  37.     </td>
  38.     <td align="center">
  39. <% if request.QueryString("colore") = "" then %>    
  40.     Seleziona un colore di sfondo
  41. <% else %>
  42.     Ho cambiato il colore di sfondo di tutte le sezioni secondo la tua scelta
  43. <% end if %>
  44.  
  45.     <form action="personalizza.asp" method="get">
  46.     <select name="colore">
  47.         <option value="#FFFF99">giallo</option>
  48.         <option value="#FFCCCC">rosa</option>
  49.         <option value="#66CCFF">celeste</option>
  50.         <option value="#FFFFFF">bianco</option>
  51.     </select>
  52.     <input type="hidden" name="sezione" value="personalizza">
  53.     <input type="submit" value="Seleziona">
  54.     </form>
  55.  
  56.     </td>
  57. </tr>
  58. </table>
  59.  
  60. </body>
  61. </html>
  62.  
  63. <%    else 
  64.     ' L'utente non si Φ registrato correttamente
  65. %>
  66.  
  67. <html>
  68. <head><title>Errore di accesso</title></head>
  69. <body>Attenzione: accesso non consentito</body>
  70. </html>
  71.  
  72. <%    end if %>
  73.